package it.softphone.commons.json.server.jersey;

import it.softphone.commons.json.server.JSONException;

/**
 * class useful to convert string parameter to JSOMNobject
 * 
 * example
 * <pre>
 * 
 *	@GET
 *	public Response method( @QueryParam("json") JSONParam jsonParam ) { }
 * </pre>
 * 
 * @author bsorrentino
 *
 */
public class JSONParam {
	private final String value;
	
	public JSONParam( String param ) {
		value = param;
	}

	public it.softphone.commons.json.server.JSONObject toObject()  throws JSONException  {
		return new  it.softphone.commons.json.server.JSONObject( value );
	}
	
	@Override
	public String toString() {
		return value;
	}
	
	
	

}
